// 	Name: 10.c
//	Description: Chapter 6 project 10
//	Author: StableGenius
//	Date: 2020-07-09
//	Email: feng@dongfa.pro

#include <stdio.h>
#include <limits.h>
#include <stdbool.h>

int main(void) {
	int month, day, year, total = 0,
        min_total = INT_MAX,
        min_month, min_day, min_year;

	do {
		printf("Enter a date (mm/dd/yy): ");
		scanf("%d/%d/%d", &month, &day, &year);
		total = month * 30 + day + year * 365;
		
		if (total == 0) break;

		if (total < min_total) {
			min_total = total;
			min_day = day;
			min_month = month;
			min_year = year;
		}
	} while (true);

	printf("%d/%d/%.2d is the earliest date.\n", min_month, min_day, min_year);

	return 0;
}
